{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style >
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0px;
        margin-top: 0px
    }

    #title span {
        float: right;
    }

    .asdlkjasd {
        background: #1ab394;
        color: #fff
    }

    td {
        word-wrap: break-word;
        word-break: break-all;
        max-width: 700px;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar" style="text-align: center;margin-bottom: 20px">
                        <h2>聊天数量: <span style="color: #1ab394; margin-right: 100px;">{$count}</span>
                        男女用户对数: <span style="color: #1ab394; ">{$count_group}</span></h2>
                    </div>

                    <div class="fixed-table-toolbar">
                        <div style="display:inline-block;float: left;">
                        <a class="btn btn-default btn-outline {present name='type'}{eq name='type' value='0'}asdlkjasd{/eq}{/present}" href="{:url('unreplylist',['touids'=>$touids,'date'=>$date])}">全部</a>
                        <a class="btn btn-default btn-outline {present name='type'}{eq name='type' value='1'}asdlkjasd{/eq}{/present}" href="{:url('unreplylist',['type'=>1,'touids'=>$touids,'date'=>$date])}">单边</a>
                        <a class="btn btn-default btn-outline {present name='type'}{eq name='type' value='2'}asdlkjasd{/eq}{/present}" href="{:url('unreplylist',['type'=>2,'touids'=>$touids,'date'=>$date])}">未删除</a>
                        <a class="btn btn-default btn-outline {present name='type'}{eq name='type' value='3'}asdlkjasd{/eq}{/present}" href="{:url('unreplylist',['type'=>3,'touids'=>$touids,'date'=>$date])}">已删除</a>
                        <a class="btn btn-default btn-outline {present name='type'}{eq name='type' value='4'}asdlkjasd{/eq}{/present}" href="{:url('unreplylist',['type'=>4,'touids'=>$touids,'date'=>$date])}">已读</a>
                        <a class="btn btn-default btn-outline {present name='type'}{eq name='type' value='5'}asdlkjasd{/eq}{/present}" href="{:url('unreplylist',['type'=>5,'touids'=>$touids,'date'=>$date])}">未读</a>
                        </div>

                        <form  method="get" action="{:url('unreplylist',['type'=>$type,'touids'=>$touids,'date'=>$date])}" style="float: left;margin-left: 100px;">
                            <div class="pull-left search" style="display: flex;">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="search">
                                        <option value="userid" {php}if(input('?param.search')){if(input('param.search')=='userid'){echo "selected";} }{/php}>发送方</option>
                                        <option value="touserid" {php}if(input('?param.search')){if(input('param.search')=='touserid'){echo "selected";} }{/php}>接收方</option>
                                    </select>
                                </div>

                                <div class="pull-right search">
                                    <input class="form-control input-outline" type="text"
                                           {php}
                                           if(input('?param.name')){
                                    if(input('param.name')){
                                    echo "value='".input('name')."'";
                                    }

                                    }
                                    {/php}
                                    name="name" placeholder="输入双方ID，用,隔开">
                                </div>

                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit" id="search-btn">搜索</button>
                                </div>

                                {php}
                                if(input('?param.name')){
                                {/php}
                                <div class="pull-right search">
                                    <a class="btn btn-w-m btn-link" href="{:url('unreplylist',['type'=>$type,'touids'=>$touids,'date'=>$date])}">返回列表</a>
                                </div>{php}
                                }
                                {/php}
                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                            <tr>
                                <th class="bs-checkbox"><input type="checkbox" id="delidAll"></th>
                                <th data-align="center">消息ID</th>
                                <th data-align="center">发送方</th>
                                <th data-align="center">接收方</th>
                                <th data-align="center">单边</th>
                                <th data-align="center">状态</th>
                                <th data-align="center">已读</th>
                                <th>内容</th>
                                <th data-align="center">时间</th>
                                <th data-align="center">管理</th>
                            </tr>
                            </thead>
                            <tbody id="form">
                                {php}
                                $singles = ['否','仅对方可见','对方不可见'];
                                {/php}
                            {volist name="data" id="v"}
                            <tr id="id{$v.id}" class="class">
                                <td id="delid" ><input name="delAll[]" type="checkbox" value="{$v.id}"></td>
                                <td>{$v.chat_id}</td>
                                <td><a onClick="member('{$v.userid}')" style="color:#40BCF7">{:getname($v.userid)}</a><br > ({$v.userid})</td>
                                <td><a onClick="member('{$v.touserid}')" style="color:#40BCF7">{:getname($v.touserid)}</a> <br > ({$v.touserid})</td>
                                <td>{$singles[$v.chat_single]}</td>
                                <td>{$v.chat_status==2?'已删除':'正常'}</td>
                                <td>{$v.chat_isread?'已读':'未读'}</td>
                                <td>{$v.chat_content}</td>
                                <td>{$v.chat_addtime}</td>
                                    <td>
                                        <a onclick="chat('{$v.userid},{$v.touserid}')" style="color:#40BCF7">查看对话</a>
                                    </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
<div id="LianmaiDetail" style="text-align:center;display:none;margin: 0px 30px;padding:10px 100px">
</div>
<script>
    $(document).ready(function(){
        $('#delidAll').click(function(){
            $('input[type=checkbox]').each(function(){
                var self=$(this);
                if(!self.prop('checked')){
                    self.prop('checked',true);
                }else{
                    self.prop('checked',false);
                }
            });
        })
    });
    function member(id)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("member/index")}?search=id&name='+id
            });
        });
    }

    function chat(uids)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("usertalk/records")}?search=userid&name='+uids
            });
        });
    }
</script>
{include file="public/footer" /}

